package stroe.lvyang.rsms;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.Toast;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

    }

    public void onMyButtonClick(View view) {
        SendMile sendMile = new SendMile();
        final EditText ledEdit = (EditText)findViewById(R.id.editText);
        final String text = ledEdit.getText().toString();
        Toast.makeText(this, text, Toast.LENGTH_SHORT).show();
        try {
            new Thread(new Runnable() {
                @Override
                public void run() {
                    try {
                        SendMile sendMile = new SendMile();
                        sendMile.sent(text);
                    } catch (Exception e) {
                        e.printStackTrace();
                    }

                }
            }).start();
            Toast.makeText(this, "sendMile ......", Toast.LENGTH_SHORT).show();
        }catch (Exception e){
            Toast.makeText(this,e.getMessage(), Toast.LENGTH_SHORT).show();
        }


    }
}
